<template>
  <div>
    <div class="policy">
      <div class="detailBox tcommonBox">
        <header>
          <h1 style="text-align: center">{{Policy.title}}</h1>
          <div>
            <h4 style="text-align: center">
                <div class="art-author"><i class="el-icon-time"></i>: {{Policy.publish_date}}</div>
                <div class="art-time"><i class="el-icon-user-solid"></i>：{{Policy.author}}</div>
            </h4>
          </div>
        </header>
        <div class="article-content" v-html="Policy.content" style="text-align: center"></div>
        <div style="margin-left: 20px;margin-top: 20px;margin-bottom:20px">
          <span>原文链接：</span>
          <span><a :href="Policy.url">{{Policy.title}}</a></span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      Policy: {}
    }
  },
  methods: {
    getPolicy () {
      this.$axios.get('policy/getAPolicy', {
        params: {
          id: this.$route.params.id
        }
      }).then(response => {
        this.$set(this, 'Policy', response.data.data)
      }).catch(error => {
        console.log(error)
      })
    }
  },
  mounted () {
    this.getPolicy()
  }
}
</script>

<style lang="less" scoped>
.policy{
margin-left: 40px;
margin-right: 40px;
margin-top: 20px;
background-color: white;
}
</style>
